﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ADC.BL;

namespace ADC.Web
{
    public partial class ProductDetails : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                InitData();
            }
        }


        private void InitData()
        {

            if (Request.Params["ID"] == null) return;

            var ID = Convert.ToInt32(Request.Params["ID"].ToString());


            var product = ProductFactory.GetByID(ID);
            lblName.Text = product.Name;
            lblDescription.Text = product.Description;
            lblModel.Text = product.Model;
            lblPower.Text = product.Power;
            lblMadeIn.Text = product.MadeIn;
            lblTech.Text = product.Tech;
            lblPower.Text = product.Price;
            lblWaranty.Text = product.Warranty;
            lblPrice.Text = product.Price;
            ImageProduct.ImageUrl = product.ImagePath;
        }

    }
}